<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/mall/ShareLevel.js此处编写
 -->
<template>
  <div>
    <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields" :editFormFileds="editFormFields" :editFormOptions="editFormOptions"
      :searchFormFields="searchFormFields" :searchFormFileds="searchFormFields" :searchFormOptions="searchFormOptions" :table="table" :extend="extend">
    </view-grid>
  </div>
</template>

<script>
import extend from '@/extension/mall/ShareLevel.js'
import ViewGrid from '@/components/basic/ViewGrid.vue'
var vueParam = {
  components: {
    ViewGrid,
  },
  data() {
    return {
      table: {
        key: 'id',
        footer: 'Foots',
        cnName: '分销商等级',
        name: 'ShareLevel',
        url: '/ShareLevel/',
        sortName: 'createDate',
      },
      extend: extend,
      editFormFields: {
        share_lever_sort: '',
        share_level_name: '',
        commission_type: '',
        share_level_img: [],
        commission_rate_1st: '',
        commission_rate_2nd: '',
        commission_rate_3rd: '',
        commission_amount_1st: '',
        commission_amount_2nd: '',
        commission_amount_3rd: '',
        upgrade_method: '',
        withdraw_deposit_type:'',
        condition: [],
        user_consumption_amount: '',
        user_total_1st: '',
        user_total_2nd: '',
        user_total_team: '',
        direct_sales_amount: '',
        distribution_amount_1st: '',
        distribution_amount_2nd: '',
        distribution_amount_team: '',
        direct_sales_order_total: '',
        distribution_order_total_1st: '',
        distribution_order_total_2nd: '',
        distribution_order_total_team: '',
        distribution_total_1st: '',
        distribution_total_2nd: '',
        distribution_total_team: '',
        distribution_level_1st: '',
        distribution_level_team: '',
        share_level_code: '',
        creator: '',
        createDate: '',
        createID: '',
        modifier: '',
        modifyDate: '',
        modifyID: '',
        merchantCode: '',
        merchantName: '',
        distributorCode: ''
      },
      editFormOptions: [
        [
          { required: true, title: '分销等级名称', field: 'share_level_name', colSize: 4, type: 'text' },
          { required: true, dataKey: 'sharelevel', title: '等级', field: 'share_lever_sort', colSize: 4, type: 'select' },
          { required: true, dataKey: 'CommissionType', data: [], title: '佣金类型', field: 'commission_type', colSize: 4, type: 'select' },
        ],
        [
          { title: '分销徽章', maxSize: 1, field: 'share_level_img', colSize: 4, type: 'imgupgrade', maxFile: 1, multiple: true },
          { title: '1级佣金比列', field: 'commission_rate_1st', colSize: 4, type: 'decimal', hidden: true },
          { title: '2级佣金比列', field: 'commission_rate_2nd', colSize: 4, type: 'decimal', hidden: true },
          { title: '3级佣金比列', field: 'commission_rate_3rd', colSize: 4, type: 'decimal', hidden: true },
          { title: '1级佣金金额', field: 'commission_amount_1st', colSize: 4, type: 'decimal', hidden: true },
          { title: '2级佣金金额', field: 'commission_amount_2nd', colSize: 4, type: 'decimal', hidden: true },
          { title: '3级佣金金额', field: 'commission_amount_3rd', colSize: 4, type: 'decimal', hidden: true },
        ],
        [
          { required: true, dataKey:'',data: [{ key: '1', value: "按月" },{ key: '2', value: "实时" }], title: '提现类型', field: 'withdraw_deposit_type', colSize: 6, type: 'radio' },
          { required: true, dataKey: 'UpgradeMethodType', data: [], title: '升级方式', field: 'upgrade_method', colSize: 8, type: 'radio' },
          { required: true, dataKey: 'distributorList', title: '分销商名称', field: 'distributorCode', colSize: 4, type: 'select' },
        ],
        [{ required: true, dataKey: 'UpgradeConditions', data: [], title: '升级条件', field: 'condition', colSize: 12, type: 'selectList' }],
        [
          { title: '用户消费金额', field: 'user_consumption_amount', colSize: 4, type: 'decimal', hidden: true },
          { title: '1级用户人数', field: 'user_total_1st', colSize: 4, type: 'number', hidden: true },
          { title: '2级用户人数', field: 'user_total_2nd', colSize: 4, type: 'number', hidden: true },
          { title: '团队用户人数', field: 'user_total_team', colSize: 4, type: 'number', hidden: true },
          { title: '直销分销订单金额', field: 'direct_sales_amount', colSize: 4, type: 'decimal', hidden: true },
          { title: '1级分销金额', field: 'distribution_amount_1st', colSize: 4, type: 'decimal', hidden: true },
          { title: '2级分销金额', field: 'distribution_amount_2nd', colSize: 4, type: 'decimal', hidden: true },
          { title: '团队分销金额', field: 'distribution_amount_team', colSize: 4, type: 'decimal', hidden: true },
          { title: '直销分销订单数量', field: 'direct_sales_order_total', colSize: 4, type: 'number', hidden: true },
          { title: '1级分销订单数量', field: 'distribution_order_total_1st', colSize: 4, type: 'number', hidden: true },
          { title: '2级分销订单数量', field: 'distribution_order_total_2nd', colSize: 4, type: 'number', hidden: true },
          { title: '团队分销订单数量', field: 'distribution_order_total_team', colSize: 4, type: 'number', hidden: true },
          { title: '1级分销人数', field: 'distribution_total_1st', colSize: 4, type: 'number', hidden: true },
          { title: '2级分销人数', field: 'distribution_total_2nd', colSize: 4, type: 'number', hidden: true },
          { title: '团队分销人数', field: 'distribution_total_team', colSize: 4, type: 'number', hidden: true },
          { title: '1级分销等级统计', field: 'distribution_level_1st', colSize: 4, type: 'number', hidden: true },
          { title: '团队分销等级统计', field: 'distribution_level_team', colSize: 4, type: 'number', hidden: true },
        ],
      ],
      searchFormFields: { distributorCode: '', share_lever_sort: '', share_level_name: '', commission_type: '', upgrade_method: '', condition: [],withdraw_deposit_type: null},
      searchFormOptions: [
        [
          { title: '分销等级名称', field: 'share_level_name', type: 'like' },
          { dataKey: 'sharelevel', data: [], title: '等级', field: 'share_lever_sort', type: 'select' },
          { dataKey: 'CommissionType', data: [], title: '佣金类型', field: 'commission_type', type: 'select' },
          { dataKey: 'distributorList', data: [], title: '分销商名称', field: 'distributorCode', type: 'select' },
        ],
        [
          { dataKey: 'UpgradeMethodType', data: [], title: '升级方式', field: 'upgrade_method', type: 'select' },
          { dataKey: 'UpgradeConditions', data: [], title: '升级条件', field: 'condition', type: 'selectList', colSize: 8 },
        ],
      ],
      columns: [
        { field: 'id', title: '主键', type: 'int', width: 90, hidden: true, readonly: true, require: true, align: 'left' },
        { field: 'share_lever_sort', title: '等级', type: 'string', bind: { key: 'sharelevel', data: [] }, width: 80, align: 'left', sortable: true },
        { field: 'share_level_name', title: '分销等级名称', type: 'string', width: 120, align: 'left', show: true },
        { field: 'share_level_code', title: '分销等级编码', type: 'string', width: 120, align: 'left', show: true },
        {
          field: 'distributorCode',
          title: '分销商名称',
          type: 'string',
          width: 120,
          align: 'left',
          show: true,
          bind: { key: 'distributorList', data: [] },
        },
        { field: 'share_level_img', title: '分销徽章', type: 'imgupgrade', width: 90, align: 'left' },
        { field: 'commission_type', title: '佣金类型', type: 'int', bind: { key: 'CommissionType', data: [] }, width: 95, align: 'left' },
        { field: 'commission_rate_1st', title: '1级佣金比列', type: 'decimal', width: 100, align: 'left' },
        { field: 'commission_rate_2nd', title: '2级佣金比列', type: 'decimal', width: 100, align: 'left' },
        { field: 'commission_rate_3rd', title: '3级佣金比列', type: 'decimal', width: 100, align: 'left' },
        { field: 'commission_amount_1st', title: '1级佣金金额', type: 'decimal', width: 100, align: 'left' },
        { field: 'commission_amount_2nd', title: '2级佣金金额', type: 'decimal', width: 100, align: 'left' },
        { field: 'commission_amount_3rd', title: '3级佣金金额', type: 'decimal', width: 100, align: 'left' },
        { field: 'upgrade_method', title: '升级方式', type: 'int', bind: { key: 'UpgradeMethodType', data: [] }, width: 80, align: 'left' },
        { field: 'withdraw_deposit_type', title: '提现类型', type: 'string', bind: { data: [{ key: 1, value: "按月" },{ key: 2, value: "实时" }] }, width: 80, align: 'left' },
        { field: 'condition', title: '升级条件', type: 'string', bind: { key: 'UpgradeConditions', data: [] }, width: 80, align: 'left' },
        { field: 'user_consumption_amount', title: '用户消费金额', type: 'int', width: 100, align: 'left' },
        { field: 'user_total_1st', title: '1级用户人数', type: 'int', width: 100, align: 'left' },
        { field: 'user_total_2nd', title: '2级用户人数', type: 'int', width: 100, align: 'left' },
        { field: 'user_total_team', title: '团队用户人数', type: 'int', width: 100, align: 'left' },
        { field: 'direct_sales_amount', title: '直销分销订单金额', type: 'decimal', width: 130, align: 'left' },
        { field: 'distribution_amount_1st', title: '1级分销金额', type: 'decimal', width: 100, align: 'left' },
        { field: 'distribution_amount_2nd', title: '2级分销金额', type: 'decimal', width: 100, align: 'left' },
        { field: 'distribution_amount_team', title: '团队分销金额', type: 'decimal', width: 100, align: 'left' },
        { field: 'direct_sales_order_total', title: '直销分销订单数量', type: 'int', width: 130, align: 'left' },
        { field: 'distribution_order_total_1st', title: '1级分销订单数量', type: 'int', width: 130, align: 'left' },
        { field: 'distribution_order_total_2nd', title: '2级分销订单数量', type: 'int', width: 130, align: 'left' },
        { field: 'distribution_order_total_team', title: '团队分销订单数量', type: 'int', width: 130, align: 'left' },
        { field: 'distribution_total_1st', title: '1级分销人数', type: 'int', width: 100, align: 'left' },
        { field: 'distribution_total_2nd', title: '2级分销人数', type: 'int', width: 100, align: 'left' },
        { field: 'distribution_total_team', title: '团队分销人数', type: 'int', width: 100, align: 'left' },
        { field: 'distribution_level_1st', title: '1级分销等级统计', type: 'int', width: 130, align: 'left' },
        { field: 'distribution_level_team', title: '团队分销等级统计', type: 'int', width: 130, align: 'left' },
        { field: 'creator', title: '创建人', type: 'string', width: 100, align: 'left', show: true },
        { field: 'createDate', title: '创建时间', type: 'datetime', width: 160, align: 'left', sortable: true },
        { field: 'createID', title: '创建人ID', type: 'int', width: 90, hidden: true, align: 'left' },
        { field: 'modifier', title: '修改人', type: 'string', width: 100, align: 'left', show: true },
        { field: 'modifyDate', title: '修改时间', type: 'datetime', width: 160, align: 'left', sortable: true },
        { field: 'modifyID', title: '修改人ID', type: 'int', width: 90, hidden: true, align: 'left' },
        { field: 'merchantCode', title: '商户编码', type: 'string', width: 220, hidden: true, align: 'left' },
        { field: 'merchantName', title: '商户名称', type: 'string', width: 220, hidden: true, align: 'left' },
      ],
      detail: {
        cnName: '#detailCnName',
        columns: [],
        sortName: '',
        key: '',
      },
    }
  },
}
export default vueParam
</script>
